.PHONY:all
all:write read

write:write.cc contacts.pb.cc phone.pb.cc
	g++ -std=c++11 $^ -o $@ -lprotobuf

read:read.cc contacts.pb.cc phone.pb.cc
	g++ -std=c++11 $^ -o $@ -lprotobuf

protobuf:contacts.proto phone.proto
	protoc --cpp_out=. $^

print:
	protoc --decode=contacts.contacts add_contacts.proto < contacts.bin

.PHONY:clean_protobuf
clean_protobuf:
	rm -rf contacts.pb.h contacts.pb.cc

.PHONY:clean
clean:
	rm -rf write read